FROM hadoop:3.3.0
MAINTAINER qpwu wqp0010@gmail.com

ARG HBASE_VERSION=2.4.8

ENV PATH $PATH:/hbase/bin

ENV JAVA_HOME=/usr/local/openjdk-8/

LABEL Description="HBase" \
      "HBase Version"="$HBASE_VERSION"

WORKDIR /

#更改时区
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
        && echo "Asia/Shanghai" > /etc/timezone

# Install hbase
RUN mkdir -p "hbase-$HBASE_VERSION" \
  && export ARCHIVE=hbase-$HBASE_VERSION-bin.tar.gz \
  && export DOWNLOAD_PATH=apache/hbase/$HBASE_VERSION/$ARCHIVE \
  && curl -sSL https://mirrors.bfsu.edu.cn/$DOWNLOAD_PATH | \
    tar -xz -C "hbase-$HBASE_VERSION" --strip-components 1 \
  && ln -sv "hbase-$HBASE_VERSION" hbase \
  && rm -rf $ARCHIVE

VOLUME /opt/hbaseData
VOLUME /opt/zkData

COPY entrypoint.sh /
COPY conf/hbase-site.xml /hbase/conf/
COPY conf/hbase-env.sh /hbase/conf/

RUN apt-get update
RUN apt-get -y install net-tools vim libsnappy-dev

#安装ssl 用apt-get install的版本太高 hadoop识别错误.如果用不到ssl下面这步可以省略
RUN wget https://mirrors.bfsu.edu.cn/debian/pool/main/o/openssl1.0/libssl1.0-dev_1.0.2u-1~deb9u1_amd64.deb \
    && wget https://mirrors.bfsu.edu.cn/debian/pool/main/o/openssl1.0/libssl1.0.2_1.0.2u-1~deb9u1_amd64.deb \
    && dpkg -i libssl1.0.2_1.0.2u-1~deb9u1_amd64.deb \
    && dpkg -i libssl1.0-dev_1.0.2u-1~deb9u1_amd64.deb \
    && rm -rf libssl1.0.2_1.0.2u-1~deb9u1_amd64.deb \
    && rm -rf libssl1.0-dev_1.0.2u-1~deb9u1_amd64.deb

EXPOSE 2181 18000 18010 18020

ENTRYPOINT ["/entrypoint.sh"]